QuickTime Movie File Format Specification, May 1996
| Previous | Chapter contents | Chapter top | Next |
The basic data unit in a QuickTime file is the atom. Each atom contains size and type information along with its data. The size field indicates the number of bytes in the atom, including the size and type fields. The type field specifies the type of data stored in the atom and, by implication, the format of that data. Both the size and type fields are 32-bit integers.
Atoms are recursive in nature. That is, one atom may contain one or more other atoms of varying type. For example, a movie atom contains one track atom for each track in the movie. The track atoms, in turn, contain one or more media atoms each, along with other atoms that define other track and movie characteristics. This hierarchical structure of atoms is referred to as a containment hierarchy.
The format of the data stored within a given atom cannot be determined based only on the type field of that atom. That is, an atom's use is determined by its context. A given atom type may have different usages when stored within atoms of different types. This means that all QuickTime file readers must take into consideration not only the atom type, but the atom's containment hierarchy.
Figure 0-1 shows the layout of a sample QuickTime atom. Each atom carries its own size and type information as well as its data. Throughout this chapter, the name of a container atom (an atom that contains other atoms, including other container atoms) is printed across a horizontal gray band, and the name of a leaf atom (an atom that contains no other atoms) is printed across a horizontal drop shadow box. Leaf atoms contain data, usually in the form of tables.
Atoms within container atoms do not have to be in any particular order, with the exception of handler description atoms. Handler description atoms must come before their data. For example, a media handler description atom must come before a media information atom. A data handler description atom must come before a data information atom.
Figure 1 A sample QuickTime atom
Atoms consist of a header, followed by atom data. An atom header consists of the following fields.
The only way to interpret the atom's data is by knowing the type of data that is stored in an atom of a particular type.
| Previous | Chapter contents | Chapter top | Next |